var e = getApp();

Page({
    data: {
        pictureList: [],
        install_order_goods_id: 0,
        order_sn: "",
        message: ""
    },
    onLoad: function(e) {
        this.setData({
            install_order_goods_id: e.install_order_goods_id,
            order_sn: e.order_sn
        });
    },
    onReady: function() {},
    onShow: function() {},
    sendBtn: function() {
        var t = this.data, a = t.install_order_goods_id, o = t.message, n = t.pictureList, s = e.getNetAddresss("plugin.live-install.frontend.order.applyAfterSale");
        e._postNetWork({
            url: s,
            data: {
                install_order_goods_id: a,
                refund_reason: o,
                refund_image: n
            },
            success: function(t) {
                var a = t.data;
                if (e.tips(a.msg), 1 == a.result) {
                    var o = getCurrentPages();
                    o[o.length - 2].getDetails(), wx.navigateBack();
                }
            }
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onRead_2: function() {
        var e = this;
        wx.chooseImage({
            count: 9,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(t) {
                console.log(t.tempFilePaths), e.unload({
                    tempFilePaths: t.tempFilePaths
                });
            }
        });
    },
    unload: function(t) {
        var a = this;
        if (0 != t.tempFilePaths.length) {
            wx.showLoading({
                title: "上传中"
            });
            var o = e.getNetAddresss("upload.uploadPic");
            wx.uploadFile({
                url: o,
                filePath: t.tempFilePaths[0],
                name: "file",
                formData: null,
                success: function(e) {
                    var t = JSON.parse(e.data), o = a.data.pictureList;
                    o.push(t.data.img_url), a.setData({
                        pictureList: o
                    });
                },
                complete: function(e) {
                    wx.hideLoading(), t.tempFilePaths.shift(), a.unload(t);
                }
            });
        }
    },
    onShareAppMessage: function() {}
});